- page_title _('SSH Keys')
- add_page_specific_style 'page_bundles/profile'
- @force_desktop_expanded_sidebar = true
- hide_class = 'gl-hidden' if form_errors(@key)

= render ::Layouts::SettingsSectionComponent.new(page_title) do |c|
  - c.with_description do
    = _('SSH keys allow you to establish a secure connection between your computer and GitLab.')
    - config_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_instance_configuration_url }
    = html_escape(s_('SSH fingerprints verify that the client is connecting to the correct host. Check the %{config_link_start}current instance configuration%{config_link_end}.')) % { config_link_start: config_link_start, config_link_end: '</a>'.html_safe }

  - c.with_body do
    = render ::Layouts::CrudComponent.new(_('Your SSH keys'),
      icon: 'key',
      count: @keys.count,
      toggle_text: _('Add new key'),
      toggle_options: { class: hide_class },
      form_options: { form_errors: form_errors(@key) }) do |c|
      - c.with_form do
        %h4.gl-mt-0
          = _('Add an SSH key')
        %p
          - help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/ssh.md') }
          = _('Add an SSH key for secure access to GitLab. %{help_link_start}Learn more%{help_link_end}.').html_safe % {help_link_start: help_link_start, help_link_end: '</a>'.html_safe }
        = render 'form'

      - c.with_body do
        = render 'key_table'
